class CulturalHeritage::CollectionStatesController < ApplicationController
  #Just checking
  # GET /cultural_heritage/collection_states
  # GET /cultural_heritage/collection_states.xml
  def index
    @title_view = 'Estados'
    @cultural_heritage_collection_states = CulturalHeritage::CollectionState.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @cultural_heritage_collection_states }
    end
  end

  # GET /cultural_heritage/collection_states/1
  # GET /cultural_heritage/collection_states/1.xml
  def show
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @cultural_heritage_collection_state }
    end
  end

  # GET /cultural_heritage/collection_states/new
  # GET /cultural_heritage/collection_states/new.xml
  def new
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @cultural_heritage_collection_state }
    end
  end

  # GET /cultural_heritage/collection_states/1/edit
  def edit
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.find(params[:id])
  end

  # POST /cultural_heritage/collection_states
  # POST /cultural_heritage/collection_states.xml
  def create
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.new(params[:cultural_heritage_collection_state])

    respond_to do |format|
      if @cultural_heritage_collection_state.save
        format.html { redirect_to(@cultural_heritage_collection_state, :notice => 'Collection state was successfully created.') }
        format.xml  { render :xml => @cultural_heritage_collection_state, :status => :created, :location => @cultural_heritage_collection_state }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @cultural_heritage_collection_state.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /cultural_heritage/collection_states/1
  # PUT /cultural_heritage/collection_states/1.xml
  def update
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.find(params[:id])

    respond_to do |format|
      if @cultural_heritage_collection_state.update_attributes(params[:cultural_heritage_collection_state])
        format.html { redirect_to(@cultural_heritage_collection_state, :notice => 'Collection state was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @cultural_heritage_collection_state.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /cultural_heritage/collection_states/1
  # DELETE /cultural_heritage/collection_states/1.xml
  def destroy
    @cultural_heritage_collection_state = CulturalHeritage::CollectionState.find(params[:id])
    @cultural_heritage_collection_state.deleted = 1
    @cultural_heritage_collection_state.save

    respond_to do |format|
      format.html { redirect_to(cultural_heritage_collection_states_url) }
      format.xml  { head :ok }
    end
  end
end
